<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>setTimeout</title>

    <script>

        function showTime(){
            console.log( Date.now() );
        }

        console.log( Date.now() );

        // 创建一个在指定延迟时间后执行指定任务的定时器
        let timer1 = setTimeout( showTime , 5000 );
        console.log( timer1 , typeof( timer1 ) );

        let timer2 = setTimeout( showTime , 5000 );
        console.log( timer2 , typeof( timer2 ) );

        // 清除定时器
        clearTimeout( timer1 );


    </script>

</head>
<body>
    
</body>
</html>